//
//  WHNButton.m
//  YiQiTingShu
//
//  Created by WeiWei on 15/11/7.
//  Copyright © 2015年 直到世界的尽头. All rights reserved.
//

#import "WHNButton.h"

@implementation WHNButton

- (id)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
//        [self addTarget:self action:@selector(Clicked) forControlEvents:UIControlEventTouchUpInside];

        
            [self setImage:[UIImage imageNamed:@"zanting.png"] forState:UIControlStateSelected];
            [self setImage:[UIImage imageNamed:@"bofang.png"] forState:UIControlStateNormal];
       

//        [self setImage:[UIImage imageNamed:@"bofang.png"] forState:UIControlStateNormal];
//        [self setImage:[UIImage imageNamed:@"zanting.png"] forState:UIControlStateSelected];

    }
    return self;
}

- (void)layoutSubviews {
    [super layoutSubviews];
}

//- (void)Clicked {
//    self.selected = !self.selected;
//}

- (void)setImage:(UIImage *)image forState:(UIControlState)state
{
    [super setImage:image forState:state];
    
    [self sizeToFit];
}

@end
